<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
class PHPExcel_Style_Protection extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable
{
    protected $locked;
    protected $hidden;
    const PROTECTION_INHERIT = "inherit";
    const PROTECTION_PROTECTED = "protected";
    const PROTECTION_UNPROTECTED = "unprotected";
    public function __construct($isSupervisor = false, $isConditional = false)
    {
        parent::__construct($isSupervisor);
        if(!$isConditional) {
            $this->locked = "inherit";
            $this->hidden = "inherit";
        }
    }
    public function getSharedComponent()
    {
        return $this->parent->getSharedComponent()->getProtection();
    }
    public function getStyleArray($array)
    {
        return ["protection" => $array];
    }
    public function applyFromArray($pStyles = NULL)
    {
        if(is_array($pStyles)) {
            if($this->isSupervisor) {
                $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
            } else {
                if(isset($pStyles["locked"])) {
                    $this->setLocked($pStyles["locked"]);
                }
                if(isset($pStyles["hidden"])) {
                    $this->setHidden($pStyles["hidden"]);
                }
            }
            return $this;
        }
        throw new PHPExcel_Exception("Invalid style array passed.");
    }
    public function getLocked()
    {
        if($this->isSupervisor) {
            return $this->getSharedComponent()->getLocked();
        }
        return $this->locked;
    }
    public function setLocked($pValue = self::PROTECTION_INHERIT)
    {
        if($this->isSupervisor) {
            $styleArray = $this->getStyleArray(["locked" => $pValue]);
            $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
        } else {
            $this->locked = $pValue;
        }
        return $this;
    }
    public function getHidden()
    {
        if($this->isSupervisor) {
            return $this->getSharedComponent()->getHidden();
        }
        return $this->hidden;
    }
    public function setHidden($pValue = self::PROTECTION_INHERIT)
    {
        if($this->isSupervisor) {
            $styleArray = $this->getStyleArray(["hidden" => $pValue]);
            $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
        } else {
            $this->hidden = $pValue;
        }
        return $this;
    }
    public function getHashCode()
    {
        if($this->isSupervisor) {
            return $this->getSharedComponent()->getHashCode();
        }
        return md5($this->locked . $this->hidden . "PHPExcel_Style_Protection");
    }
}

?>